UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BIOfZfHoDgw26G5JRije4tgItDSdKwvbRCUuoBVBMPk=' 
WHERE 
  key_id = '0113fbc22d3757d3cd553b67f00a45e70dc167ae817e30abb37dba6d88853905' 
  AND (
    token = 'BIOfZfHoDgw26G5JRije4tgItDSdKwvbRCUuoBVBMPk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00113