UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zcROyCqNp8uBOdXzYOTNy6PC3lWOWiW1OoRZ75x2eLQ=' 
WHERE 
  key_id = 'b75986f45ce60b518a8061ecdeac2697d189cdf1166ada7b7dddaa276f6cced5' 
  AND (
    token = 'zcROyCqNp8uBOdXzYOTNy6PC3lWOWiW1OoRZ75x2eLQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035