UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CatdHvpMJhK5Ef2m1+SpRb0ouzu1u8lSDXbh/aacgig=' 
WHERE 
  key_id = '111d2d4c3b6052ea1db5e1eef62d8516daef8edcea63b9488b2eb9c011c7e8b4' 
  AND (
    token = 'CatdHvpMJhK5Ef2m1+SpRb0ouzu1u8lSDXbh/aacgig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032