UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dAcp5r9YJx4PlpXhEfBqhvDvBHWnGp5xF+QLxQzLmFM=' 
WHERE 
  key_id = '6770dea6877df03ec7a9ad8deabffd25d7e5a537205e6374f48398098d34d7f4' 
  AND (
    token = 'dAcp5r9YJx4PlpXhEfBqhvDvBHWnGp5xF+QLxQzLmFM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026