UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2t178G3KRxyJHAVJ6IROwjDbytxQFFU0ywqaRANS7AA=' 
WHERE 
  key_id = '6544f040882445eb7901ed882d74c524a0ec9e02ae7324f7c19d02e6ffbbd3ae' 
  AND (
    token = '2t178G3KRxyJHAVJ6IROwjDbytxQFFU0ywqaRANS7AA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015