UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F5SOASEroUuwZO1TjrQAndp+JiJ8caoWFHxIJkn8tQQ=' 
WHERE 
  key_id = '0b73401930d77988069a3c6bb31e9708cd2036b35247004b7a39222a99904881' 
  AND (
    token = 'F5SOASEroUuwZO1TjrQAndp+JiJ8caoWFHxIJkn8tQQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021