UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3hL/RVxqCUvg/aAwSZWhNWardzGKppopWGgPR6AbHF8=' 
WHERE 
  key_id = '8bf7cacdc6cf94a29951c5d079d656e5bd3f0d38b07646576579067086fe5ddf' 
  AND (
    token = '3hL/RVxqCUvg/aAwSZWhNWardzGKppopWGgPR6AbHF8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040