UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vMGY5ovb7w9hLl18D3/ynbL+LDx55QdBEZWFnw86BEk=' 
WHERE 
  key_id = '1dcf57425e293a9b753319a30a783a2d8ba54790d1d3521a61f1ec6b8d58cbf3' 
  AND (
    token = 'vMGY5ovb7w9hLl18D3/ynbL+LDx55QdBEZWFnw86BEk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033