UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zDI1L21Z53d68L03VqW/SgOTXtt8UZtOxON3GnEngUA=' 
WHERE 
  key_id = '02001ba60f4cda1c8acc906042948cdd99d8a610c8db37e47e1e5a41591a5b51' 
  AND (
    token = 'zDI1L21Z53d68L03VqW/SgOTXtt8UZtOxON3GnEngUA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017