UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nixJPXDhYu2au737Vxi/m+/aNnLr0pYsgZ4uLzgtbw4=' 
WHERE 
  key_id = 'cb1081418beef875fab4215af99d12ed21865d7e514aa2aef1053837085ef305' 
  AND (
    token = 'nixJPXDhYu2au737Vxi/m+/aNnLr0pYsgZ4uLzgtbw4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032