UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wdSwQgPY3/tvGXPbGbc2j5p9iZk4P7U/qDgRXtlRhlk=' 
WHERE 
  key_id = 'e3d3fa1fa82bb63eefb51ae292994129bf5841c1aebf564af28a976584878e84' 
  AND (
    token = 'wdSwQgPY3/tvGXPbGbc2j5p9iZk4P7U/qDgRXtlRhlk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030