UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MAhbANrY2KyCmUfHeelJ5kHD8WSt5pQLdGzLf14XKQU=' 
WHERE 
  key_id = '73c980fe16ce6d3472e4df6e76d9547fc176cdea793d5f5766c20ff1fe9c4e4b' 
  AND (
    token = 'MAhbANrY2KyCmUfHeelJ5kHD8WSt5pQLdGzLf14XKQU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032