UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IL9jYx/VS+ACXg3NG4CYHaODg021sVVZRuHvnhNFPd4=' 
WHERE 
  key_id = '9c36828f99237851a7a8ba5044fded8ea65b7c982f1f292a59f726c5cc78ea16' 
  AND (
    token = 'IL9jYx/VS+ACXg3NG4CYHaODg021sVVZRuHvnhNFPd4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034