UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3NbDBBW/m80PZ7HfsGeDef2jzwS/JHXW3ONiCTLVOhc=' 
WHERE 
  key_id = '28bfd5a408f73abb4a28cd947346e18dfe4dbf441de89cc0057036bf2021b9fe' 
  AND (
    token = '3NbDBBW/m80PZ7HfsGeDef2jzwS/JHXW3ONiCTLVOhc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048