UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NeaMXTBPsI0kcDn/chxlMRz5YPtynAm1lASJG7RGiZ0=' 
WHERE 
  key_id = '0004529db6903c9b88e9601781a62e9adf3009c83e216cf1117b71203df6649c' 
  AND (
    token = 'NeaMXTBPsI0kcDn/chxlMRz5YPtynAm1lASJG7RGiZ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024