UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EECUd4fmh1+SaqWvAPjzbzGsYuJPsrUQQkDnjndz/J4=' 
WHERE 
  key_id = '35abae6f9283cd0b165b5b303799f78864e5f27d7b14cf2a06e3b24a8ddb7419' 
  AND (
    token = 'EECUd4fmh1+SaqWvAPjzbzGsYuJPsrUQQkDnjndz/J4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018