UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5aNokT8Jk4GFtvPu9Zag/jgMSXyJA7yrufIcvnvQgtg=' 
WHERE 
  key_id = '279161950fcc94830d5547f18f21071c072f34cb184e0e0592f37babcac1275f' 
  AND (
    token = '5aNokT8Jk4GFtvPu9Zag/jgMSXyJA7yrufIcvnvQgtg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037