UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bHvqCKqg1r93rIBvZNhlocTYxUC1lAfTg4oK7SXQG38=' 
WHERE 
  key_id = '3a4d637f8f3980daf8d8175dc5e600426576142238c987173d3c1fab9183a7aa' 
  AND (
    token = 'bHvqCKqg1r93rIBvZNhlocTYxUC1lAfTg4oK7SXQG38=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029