UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pxbMryLNoErA+Ymj0K4auGRXsPFD7Ny69ADKklLe/mE=' 
WHERE 
  key_id = 'e6791ec4b4e0da1081e00a94a2b9351c712535ce9c212dd2cd837ef532cc669c' 
  AND (
    token = 'pxbMryLNoErA+Ymj0K4auGRXsPFD7Ny69ADKklLe/mE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038