UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GePWSc0TFq/ejN0U0zkvHk52ZKtg1y+AH/Idhq5UPkc=' 
WHERE 
  key_id = '71ded355010610bcae8db2b9dab9c361c47518172492850458abb8643819e48f' 
  AND (
    token = 'GePWSc0TFq/ejN0U0zkvHk52ZKtg1y+AH/Idhq5UPkc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049