UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6BsUYbKV+PjTsK3/KrNgB4nt51EeAA8KmCs4eukuSdA=' 
WHERE 
  key_id = '7f0775afc115b33e0d740fd8b3f7cc96cc27f02ab3f0d38c36c9271b8c0a2eea' 
  AND (
    token = '6BsUYbKV+PjTsK3/KrNgB4nt51EeAA8KmCs4eukuSdA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039