UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aowu9fgk6VdvZ+ETy2ODXFhoQa4ZaIPhhPNVdfCou9c=' 
WHERE 
  key_id = '122de3fbf964da4f2bab4407b0b7f6b28849eaeda12fc3e8183b7c719f6e8578' 
  AND (
    token = 'aowu9fgk6VdvZ+ETy2ODXFhoQa4ZaIPhhPNVdfCou9c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036