UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uOLZmM3cGPEGQ9kvu6hHmRUlH6zGUnhWnM1O65xwQ8w=' 
WHERE 
  key_id = '52e7121d9ebc7cd9eb570f38f8fe6efa3ebc89d794c9e320f50108319ebc07f5' 
  AND (
    token = 'uOLZmM3cGPEGQ9kvu6hHmRUlH6zGUnhWnM1O65xwQ8w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036