UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9SO6+a5uU8uZ1QZje0K9IfT0li51/kU/KrXm/gZJpQM=' 
WHERE 
  key_id = '18bea7b09160de449747aca17c89f60b346d8c7d1fec15a16723ef7d5623a050' 
  AND (
    token = '9SO6+a5uU8uZ1QZje0K9IfT0li51/kU/KrXm/gZJpQM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036