UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '447m5MzKLAe/T5z4idDvNYH6fmW9qtQ4enf10kz95Fw=' 
WHERE 
  key_id = '2e4d31e05a434a21a8f3e12a350ac6bfd83ca7259af19d978e67b1cc62e69ee8' 
  AND (
    token = '447m5MzKLAe/T5z4idDvNYH6fmW9qtQ4enf10kz95Fw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018