UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'flo3hXmHJGcwMrbRZONlDI6T1biSJOeofo/1iBXxKTA=' 
WHERE 
  key_id = '952003ff3dcd8b886c0a8ff10123e774e25ea1c4aa01c5779ce02e504a3bb7b3' 
  AND (
    token = 'flo3hXmHJGcwMrbRZONlDI6T1biSJOeofo/1iBXxKTA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030