UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w5T9clcre5uiGDQzG0tmPt2a2GQBWNe3H7PAWDpbv5U=' 
WHERE 
  key_id = 'e63bb2a2edf7c514b40e354b86072dc757f8a11d75c4a1bb034bbd31b001790c' 
  AND (
    token = 'w5T9clcre5uiGDQzG0tmPt2a2GQBWNe3H7PAWDpbv5U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036