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

Query time 0.00031