UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '34K51z6UjLlW9EndDeYIvIkIEgVej3aBpCeToqo/bpo=' 
WHERE 
  key_id = '84630b0b8fc6fc55940c4aa24c3a74b2293947549b4d08f0670597061622f21f' 
  AND (
    token = '34K51z6UjLlW9EndDeYIvIkIEgVej3aBpCeToqo/bpo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030