UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8Ii4A9lUdgyZcDB6j5upl8GyNm3mdlXQDGgF5d01wcY=' 
WHERE 
  key_id = 'fe34f6a9acb8058483b8722278518713b9340a393fa1d3e6247e32933c9f2858' 
  AND (
    token = '8Ii4A9lUdgyZcDB6j5upl8GyNm3mdlXQDGgF5d01wcY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044